1. Field of the Invention
The present invention relates to a temperature compensation circuit and a sensor device, and more particularly, to a circuit configured to perform temperature compensation of the sensitivity of a sensor element.
2. Description of the Related Art
These days, various kinds of sensor devices are mounted on electronic apparatus and are utilized. For example, a magnetic sensor device is mounted on an electronic apparatus and a magnet is provided on a lid or a cover thereof When the lid or the cover is away from the electronic apparatus, the electronic apparatus provides normal operation, and, when the lid or the cover is close to the electronic apparatus, the electronic apparatus operates to shift to a power saving mode. The magnetic sensor device is configured to determine whether the lid or the cover is away from or close to the electronic apparatus using change in density of a magnetic flux from the magnet and output signals indicating whether the density of the applied magnetic flux is below or above a predetermined value so that the signals can be transferred to the electronic apparatus. In this case, it is ideal that an output signal from the sensor device is constant when the temperature changes. However, an output signal of a sensor element itself included in the sensor device depends on the temperature, and thus, it is required to mount, on the sensor device, a temperature compensation circuit for compensating for the temperature dependence of the sensor element.
FIG. 10 is an exemplary circuit diagram of a related-art temperature compensation circuit. A related-art temperature compensation circuit BL1 includes resistors R11 to R14 that are connected in series in this order between a power supply terminal VDD and a ground terminal VSS, and a resistor R41. A first reference voltage VTH1 is output from a first output terminal NTH1 that is a node between the resistor R11 and the resistor R12, a reference voltage VREF is output from a reference voltage terminal NREF that is a node between the resistor R12 and the resistor R13, and a second reference voltage VTH2 is output from a second output terminal NTH2 that is a node between the resistor R13 and the resistor R14. The resistor R41 is connected between the first output terminal NTH1 and the second output terminal NTH2.
With regard to the resistors R11 to R14, the resistors R11 and R14 have the same resistance value, the resistors R12 and R13 have the same resistance value, and the resistance values of the resistors R11 to R14 have the same temperature coefficient. The resistance value of the resistor R41 has a temperature coefficient that is different from the temperature coefficient of the resistance values of the resistors R11 to R14. Here, for the sake of convenience of description, the temperature coefficient of the resistance values of the resistors R11 to R14 is assumed to be larger than the temperature coefficient of the resistance value of the resistor R41. Then, the following expressions are established.
                                          VTH            ⁢                                                  ⁢            1                    -          VREF                =                  VDD          ×                                                    RX                /                R                            ⁢                                                          ⁢              11                                      2              ×                              (                                  2                  +                                                            RX                      /                      R                                        ⁢                                                                                  ⁢                    11                                                  )                                                                        (                  A          ⁢                                          ⁢          1                )                                                      VTH            ⁢                                                  ⁢            2                    -          VREF                =                              -            VDD                    ×                                                    RX                /                R                            ⁢                                                          ⁢              11                                      2              ×                              (                                  2                  +                                                            RX                      /                      R                                        ⁢                                                                                  ⁢                    11                                                  )                                                                        (        A2        )                                VREF        =                  VDD          2                                    (        A3        )            
In this case, the voltage at the ground terminal VSS is assumed to be zero. Further, RX is a resistance value between the first output terminal NTH1 and the second output terminal NTH2 and is expressed by the following expression.
                    RX        =                              2            ×            4            ⁢            R            ⁢                                                  ⁢            11            ×            R            ⁢                                                  ⁢            41                                              2              ×              R              ⁢                                                          ⁢              11                        +                          R              ⁢                                                          ⁢              41                                                          (        A4        )            
By substituting Expression (A4) into Expression (A1) and Expression (A2), the following expressions are obtained.
                                          VTH            ⁢                                                  ⁢            1                    -          VREF                =                              +            VDD                    ×                      1                          4              ·                              (                                                      R                    ⁢                                                                                  ⁢                                          11                      /                      R                                        ⁢                                                                                  ⁢                    41                                    +                  1                                )                                                                        (        A5        )                                                      VTH            ⁢                                                  ⁢            2                    -          VREF                =                              -            VDD                    ×                      1                          4              ·                              (                                                      R                    ⁢                                                                                  ⁢                                          11                      /                      R                                        ⁢                                                                                  ⁢                    41                                    +                  1                                )                                                                        (        A6        )            
As the temperature becomes higher, the resistance value of the resistor R41 becomes smaller with respect to the resistance value of the resistor R11, and thus, the term R11/R41 becomes larger as the temperature becomes higher. As shown in FIG. 11, (VTH1−VREF) becomes smaller as the temperature becomes higher. (VREF−VTH2) also becomes smaller as the temperature becomes higher. As described above, through allowing the reference voltage to be temperature dependent and fitting the temperature coefficient of the reference voltage to the temperature coefficient of the sensor element, output of the sensor device becomes constant when the temperature changes and hence highly precise output without temperature dependence can be achieved. Further, through adjusting the resistance values of the resistor R41 and of the resistors R11 to R14 to adjust the ratio of the resistance values among the resistors having different temperature coefficients, the temperature compensation amount can be adjusted. Thus, a temperature compensation circuit applicable to a wide range of sensor devices or semiconductor devices can be achieved with a small circuit scale.
However, in the related-art temperature compensation circuit, not only the temperature compensation amount but also the compensation amount at a certain reference temperature changes, and thus, there is a problem in that a resistance value range in which both an optimum compensation amount at the reference temperature and an optimum temperature compensation amount can be attained is narrow, and a range in which the temperature compensation circuit can be used is limited. In other words, there is a problem in that the temperature compensation amount cannot be solely and independently adjusted.